package com.tarena.lbs.content.controller;

import com.tarena.lbs.base.protocol.model.Result;
import com.tarena.lbs.base.protocol.pager.PageResult;
import com.tarena.lbs.content.pojo.vo.ArticleCategoryVO;
import com.tarena.lbs.content.service.CategoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "文章分类管理")
@Slf4j
@RestController
public class CategoryController {
	
	@Autowired
	private CategoryService categoryService;
	
	@Operation(summary = "查询文章分类列表")
	@GetMapping("/admin/content/category/list")
	public Result<PageResult<ArticleCategoryVO>> pageList() {
		log.debug(">>>分页查询文章分类列表-服务");
		PageResult<ArticleCategoryVO> pageResult = categoryService.selectPageList();
		return new Result<>(pageResult);
	}
	
}
